import { useNavigate } from "react-router-dom";
import { useUserStore } from "@/store/userStore";

export default function BaseBackup() {
  const navigate = useNavigate();
  const { userInfo, logout } = useUserStore();

  return (
    <div style={{ padding: 20 }}>
      <h2>首页</h2>
      <p>欢迎回来，{userInfo?.name ?? "用户"}</p>
      <button onClick={() => navigate("/chat/1")}>去聊天页 (id=1)</button>
      <button onClick={logout}>退出登录</button>
    </div>
  );
}
